import React, { Component } from 'react';
import {
    StyleSheet,
    Text,
    View,
    Image,
    TouchableOpacity,
    TouchableHighlight
} from 'react-native';

export default class ViewUtils {
    static getLeftButton(callback){
        return <TouchableOpacity
            onPress={callback}
        >
            <Image style={{width:22,height:22, margin:5}} source={require('../../res/images/ic_arrow_back_white_36pt.png')}/>
        </TouchableOpacity>
    }

    /**
     * 获取更多按钮
     * @param callback
     * @returns {*}
     */
    static getMoreButton(callback){
        return <TouchableHighlight
            underlayColor={'transparent'}
            ref="moreMenuButton"
            style={{padding: 5}}
            onPress={callback}
        >
            <View
                style={{paddingRight:8}}
            >
                <Image
                    style={{width:24,height:24, margin:5}}
                    source={require('../../res/images/ic_more_vert_white_48pt.png')}
                />
            </View>
        </TouchableHighlight>
    }

    /**
     * 获取下拉菜单按钮
     */
    static getDropDownSelect(callback){
        return <TouchableHighlight
            underlayColor={'transparent'}
            ref="moreMenuButton"
            style={{padding: 5}}
            onPress={callback}
        >
            <View
                style={{paddingRight:8}}
            >
                <Image
                    style={{width:15, height:15, margin:5}}
                    source={require('../../res/images/ic_spinner_triangle.png')}
                />
            </View>
        </TouchableHighlight>
    }
}